public class Main {
    public static void main(String[] args) {
        int i = 1;
       int count  = 0;
       for (i = 9; i < 101; i++) {
           int temp = i;
           while (temp!= 0) {
               if(temp%10==9){
                   count++;
               }
               temp/=10;
           }
       }
        System.out.println("一共有" + count  + "个9");
    }
}
